Groovy Script(“Rule name : Copy Parent Level Prediction”) to copy grid values and store in dummy members // Step 1: Get the cube and initialize variables def cube = operation.application.getCube("OEP_FS") // Step 2: Define source and target versions (hardcoded or passed as parameters) def sourceVersion = "Working" def targetVersion = "Final" String finalCalc; String periods, accounts,account; StringBuilder cscript = new StringBuilder(); try { List < String > povMemberNames = operation.grid.pov*.essbaseMbrName finalCalc = """ Fix("${povMemberNames.join('", "')}") """ cscript.append(finalCalc ) operation.grid.dataCellIterator('Predict').each {DataCell cell -> periods = cell.periodName accounts= cell.getAccountName() double chgValue = cell.getData() /* println(accounts+":"+chgValue);*/ if (accounts == "OFS_Total Travel and Entertainment Expense") { account="Travel and Entertainment" finalCalc = """ Fix("$periods") "Final" ( @CREATEBLOCK("Final"); "$account" = $chgValue; ) Endfix """ cscript.append(finalCalc) } if (accounts == "OFS_Total Marketing Expense") { account="Marketing Expenses" finalCalc = """ Fix("$periods","Final") "$account" = $chgValue; Endfix """ cscript.append(finalCalc) } if (accounts == "OFS_Total Facilities Expenses") { account="Facilities Expenses" finalCalc = """ Fix("$periods","Final") "$account" = $chgValue; Endfix """ cscript.append(finalCalc) } if (accounts == "OFS_Total Other Expenses") { account="Other Expenses" finalCalc = """ Fix("$periods","Final") "$account" = $chgValue; Endfix """ cscript.append(finalCalc) } if (accounts == "Total IT Spends") { account="IT Spends" finalCalc = """ Fix("$periods","Final") "$account" = $chgValue; Endfix """ cscript.append(finalCalc) } } cscript.append("EndFix") /*println(cscript.toString())*/ return cscript.toString() } catch (Exception e) { println("Error while copying data: " + e.message) e.printStackTrace() } /* try { // Step 3: Export Data from Source Version def exportScript = """ FIX (@RELATIVE("Sales US", 0), "${sourceVersion}") DATAEXPORT "File" "outbox/exportData.txt"; ENDFIX """.toString() cube.executeCalculation(exportScript) println("Data export from '${sourceVersion}' completed.") // Step 4: Check if export file exists (Optional) def exportFile = new File("/u01/data/exportData.txt") // Adjust path as needed if (!exportFile.exists()) { println("Export file not found. Aborting import.") return } // Step 5: Import Data into Target Version def importScript = """ FIX (@RELATIVE("Sales US", 0), "${targetVersion}") DATAIMPORT "File" "inbox/exportData.txt"; ENDFIX """.toString() cube.executeCalculation(importScript) println("Data import to '${targetVersion}' completed.") // Step 6: Confirmation println("Data copied successfully from version: " + sourceVersion + " to version: " + targetVersion) } catch (Exception e) { println("Error while copying data: " + e.message) e.printStackTrace() }*/